using NopSolutions.NopCommerce.BusinessLogic.Infrastructure;
using NopSolutions.NopCommerce.BusinessLogic.Products;

namespace NopSolutions.NopCommerce.BusinessLogic.Regions
{
    /// <summary>
    /// Represents a product Region mapping
    /// </summary>
    public partial class ProductRegion : BaseEntity
    {
        #region Properties

        /// <summary>
        /// Gets or sets the ProductRegion identifier
        /// </summary>
        public int ProductRegionID { get; set; }

        /// <summary>
        /// Gets or sets the product identifier
        /// </summary>
        public int ProductID { get; set; }

        /// <summary>
        /// Gets or sets the region identifier
        /// </summary>
        public int RegionID { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether the product is featured
        /// </summary>
        public bool IsFeaturedProduct { get; set; }

        /// <summary>
        /// Gets or sets the display order
        /// </summary>
        public int DisplayOrder { get; set; }

        #endregion 

        #region Custom Properties
        /// <summary>
        /// Gets the Region
        /// </summary>
        public Region Region
        {
            get
            {
                return IoC.Resolve<IRegionService>().GetRegionById(this.RegionID);
            }
        }

        /// <summary>
        /// Gets the product
        /// </summary>
        public Product Product
        {
            get
            {
                return IoC.Resolve<IProductService>().GetProductById(this.ProductID);
            }
        }

        #endregion

        #region Navigation Properties

        /// <summary>
        /// Gets the Region
        /// </summary>
        public virtual Region NpRegion { get; set; }

        /// <summary>
        /// Gets the product
        /// </summary>
        public virtual Product NpProduct { get; set; }

        #endregion
    }

}
